package com.spica.spicaschool.ui.diarysee

import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentManager
import androidx.fragment.app.FragmentPagerAdapter
import com.spica.spicaschool.ui.likelist.LikeListFragment
import com.spica.spicaschool.ui.replylist.ReplyListFragment

class DiarySeePagerAdapter(fm: FragmentManager, behavior: Int, did: String) :
    FragmentPagerAdapter(fm, behavior) {

    private val fragments = arrayListOf(
        ReplyListFragment.newInstance(did),
        LikeListFragment.newInstance(did)
    )

    private val titles = arrayListOf("评论", "点赞")

    override fun getCount(): Int = fragments.size

    override fun getItem(position: Int): Fragment = fragments[position]

    override fun getPageTitle(position: Int): CharSequence = titles[position]
}
